﻿using System;
using System.Reflection;
using System.Web;
using AnyOffice.Components;
using log4net;
namespace AnyOffice.general.qikan
{
    public partial class download : ModulePage
    {
        private static ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                Response.Buffer = true;
                QikanInfo qikanInfo = QikanFactory.GetQikanInfo();
                if (qikanInfo != null)
                {
                    string str = (Request.QueryString["filename"] != null) ? Request.QueryString["filename"].ToString() : "";
                    Download.ResponseFile(qikanInfo.DiskPath + str.Replace("../", "").Replace("/", @"\"));
                }
            }
            catch (Exception exception)
            {
                if (log.IsErrorEnabled)
                {
                    log.Error("", exception);
                }
            }
        }
    }
}
